home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / language / embedded / develop / libsrc11.arc / RDBYTHC.C < prev    next >
C/C++ Source or Header  |  1989-04-27  |  653b  |  33 lines

  1. /*    rdbythc.c 4.3        */
  2.  
  3. /*F****************************************************************************
  4.  
  5. FUNCTION NAME:    rdbythc
  6.  
  7. ACTION:        Reads a character from Port C using handshaked I/O.
  8.         Returns a character.
  9.  
  10. PARAMETERS:    (None)
  11.  
  12. RETURNS:    (int) byte read from port C.
  13.  
  14. ******************************************************************************/
  15.  
  16. #include <hc11/io.h>
  17. #include <hc11/pio.h>
  18. #include <hc11/directives.h>
  19.  
  20. SMALL
  21. unsigned rdbythc()
  22.  
  23.     {
  24.  
  25.     HC11.PIOC = ((HC11.PIOC) & (~OIN)) | HNDS;
  26.  
  27.     while ((HC11.PIOC & STAF) ==  0)
  28.         ;        /* null statement */
  29.  
  30.     return ((unsigned) HC11.PORTCL) ;
  31.  
  32.     }    /* end of rdbythc    */
  33.